//
//  GundongToutiao.m
//  GXWN
//
//  Created by 要帅气的生活 on 15/11/5.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "GundongToutiao.h"

@implementation GundongToutiao

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.toutiao = [[UIImageView alloc] initWithFrame:CGRectMake(3, 2, self.frame.size.width/4-3, self.frame.size.height-4)];
        [self addSubview:self.toutiao];
        self.toutiao.image = [UIImage imageNamed:@"toutiaotu.png"];
        
        
        self.page = [[UIPageControl alloc] initWithFrame:CGRectMake(self.frame.size.width/2, 0, 100, 25)];
        self.page.numberOfPages = 4;
        self.page.currentPageIndicatorTintColor = [UIColor whiteColor];
        self.page.pageIndicatorTintColor = [UIColor grayColor];
        
        self.scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(self.frame.size.width/4, 0, self.frame.size.width/4*3, self.frame.size.height)];
        self.scroll.contentSize = CGSizeMake(0, 40*4);
        self.scroll.pagingEnabled = YES;
        self.scroll.scrollEnabled = NO;
        self.scroll.showsHorizontalScrollIndicator = NO;
        self.scroll.contentOffset = CGPointMake(0, 40);
        [self addSubview:self.scroll];
        [self.scroll setUserInteractionEnabled:NO];
        
    }
    return self;
}

@end
